package at.fhooe.swa.client.domain;

import java.util.Collection;
import java.util.List;

public interface ISensorRegister
{
	/**
	 * Adds a sensor by his name-key. The name key is checked in the client. If
	 * the client registered a sensor by the name key (in the sensor.properties file) 
	 * this method will create a {@link ISensor} object and store it in a map. 
	 * @param key the name-key of the sensor
	 */
	public void addSensorByName(String key);
	
	/**
	 * Checks if the given sensor key was already registered with the register.
	 * @param key the key to be checked-
	 * @return true if the sensor can be found in the map, false otherwise
	 */
	public boolean sensorAlreadyRegisterd(String key);
	
	/**
	 * Returns the collection of registered sensors.
	 * @return the registered sensors
	 */
	public Collection<ISensor> getRegisteredSensors();
	
	/**
	 * returns a specific sensor by giving the name-key.
	 * @param key the key of the sensor to be found
	 * @return the sensor if it can be found, null otherwise
	 */
	public ISensor getSensor(String key);
	
	/**
	 * Every time the server sends data the date is stored in the register.
	 * This method returns the last update time.
	 * @return the last time the server sent an update
	 */
	public String getLastUpdateTime();
	
	/**
	 * Sets the update time whenever the server sends an update.
	 * @param dateTime the time of the server update as {@link String}
	 */
	public void setLastUpdateTime(String dateTime);
}
